package com.itheima.chapter01.method;

import java.util.Scanner;

/*
    数据遍历
 */
public class demo5 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] arr=new int[8];
        for (int i = 0; i < arr.length; i++) {
            System.out.println("请输入数组中第"+(i+1)+"个数据");
           arr[i]=sc.nextInt();
        }
        print(arr);

    }
    public  static void print(int[] arr){
        for (int i = 0; i < arr.length; i++) {
            System.out.println("数组中第"+(i+1)+"数据是"+arr[i]);
        }
    }
}
